<style scoped src="./index.scss" lang="scss" rel="stylesheet/scss"></style>
<template src="./index.html"></template>
<script>
export default {
    data() {
        return {
            username: "kim",
            password: "1",
            loading: false,
        };
    },

    components: {},

    methods: {
        async getUserInfo() {
            // 获取用户信息
            if (_data) {
                this.userInfo = _data.data;
            }
        },
        async submit() {
            this.loading = true;
            // 获取token
            let _data = await this.$vFN.Http.post({
                isSid: false,
                isToken: false,
                isLoading: false,
                domain: "STORE_MAIN_DOMAIN",
                url: "store/public/login",
                data: {
                    username: this.username,
                    password: this.password,
                },
            },window);

            if (_data._ok) {
                this.$vFN.Tools.setToken({
                    expiresIn: _data.data.expires_in,
                    token: _data.data.access_token,
                    tokenHead: _data.data.token_type,
                    window
                });
                console.error("登录成功")
                this.$router.push({
                    path: "./home",
                });
            }

            this.loading = false;
        },
    },

    computed: {},
    mounted() {
        const h = this.$createElement;

    },
    activated() {},
};
</script>